package main

import (
	"SeatSystem/internal/config"
	"SeatSystem/internal/repository"
	"SeatSystem/internal/router"
	"github.com/gin-gonic/gin"
	"log"
)

func main() {
	repository.InitDB()
	r := gin.Default()
	err := r.SetTrustedProxies([]string{"127.0.0.1"})
	r.GET("/login", router.Login)
	r.GET("/register", router.Register)
	r.GET("/userInfo", router.UserInfo)
	r.GET("/getClassList", router.GetClassList)
	r.GET("/getSeatList", router.GetSeatList)
	r.GET("/chooseSeat", router.ChooseSeat)
	r.GET("/getHistory", router.GetHistory)
	r.GET("/feedBack", router.FeedBack)
	r.GET("/getFeedBack", router.GetFeedBack)
	err = r.Run(config.Addr)
	if err != nil {
		log.Fatal("cmd.main:", err)
	}
}
